# -*- coding: utf-8 -*-

from .helper_utils import *

from .convert_module import convert_module
from .convert_node import convert_node_tasks


def parse_python_to_ir(filepath: str):
    # Get the built-in helper.
    builtin_helpers = builtin_helper()
    # Convert the module.
    ir_module = convert_module(filepath, builtin_helpers)
    # Now for all the nodes, we need to convert their tasks.
    for node_type in ir_module.nodes:
        convert_node_tasks(node_type, ir_module.helper)
    # Give back the ir_module.
    return ir_module
